//
//  STMeViewController.m
//  赛拓
//
//  Created by 王磊 on 7/28/16.
//  Copyright © 2016 立金所. All rights reserved.
//

#import "STUserViewController.h"
#import "STSettingViewController.h"
#import "STApplicationFormViewController.h"
#import "STUserTableView.h"
@interface STUserViewController ()<STBaseViewDelegate>

@property (nonatomic ,strong) STUserTableView *tableView;
@end

@implementation STUserViewController

- (void)initSubviews {
    [super initSubviews];
    
    [self configNavi];
    
    [self configSubviews];
}

- (void)configSubviews {
    
    STUserTableView *tableView = [STUserTableView instanceWithFrame:self.view.bounds];
    
    self.tableView = tableView;
    
    tableView.mDelegate = self;
    
    [self.view addSubview:tableView];
    
}
- (void)loadData {
    
    [self.tableView updateHeaderData:nil andTitleData:@[@"申请成为买家",@"申请成为卖家"]];
    
}

- (void)configNavi {
    
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemRightOffsetWithTarget:self action:@selector(rightItemClick) title:@"设置" highTitle:@"设置"];
    
    self.navigationItem.title = @"我的";
}
- (void) rightItemClick{
    
    STSettingViewController *setting = [STSettingViewController instance];
    
    [self.navigationController pushViewController:setting animated:true];
}
- (void)btnnnnnnn {
    
}

- (void)onItemClick:(STItemClickType)itemType withData:(id)data forIndexPath:(NSIndexPath *)indexPath {
    switch (itemType) {
        case STItemClickTypeItem:
        {
            
        }
            break;
        case STItemClickTypeItemTableHead:
        {
            
            
        }
            break;
        case STItemClickTypeTitle:
        {
            
            STApplicationFormViewController *appForm = [STApplicationFormViewController instance];
            
            switch (indexPath.row) {
                case 0:
                    appForm.title = @"申请成为买家";
                    break;
                default:
                    appForm.title = @"申请成为卖家";
                    break;
            }
            [self.navigationController pushViewController:appForm animated:true];
        }
            break;
        default:
            break;
    }
    
    
}
@end
